SPIRAL
Overview
Calculate the loss coefficient (K) for a spiral coil pipe section.
Excel Usage
=SPIRAL(Di, rmax, rmin, pitch, fd)
Di(float, required): Inside diameter of pipe [m]rmax(float, required): Radius of spiral at extremity [m]rmin(float, required): Radius of spiral at end near center [m]pitch(float, required): Distance between two subsequent coil centers [m]fd(float, required): Darcy friction factor [-]
Returns (float): Loss coefficient K for the spiral [-]
Examples
Example 1: Basic spiral coil
Inputs:
| Di | rmax | rmin | pitch | fd |
|---|---|---|---|---|
| 0.01 | 0.1 | 0.02 | 0.01 | 0.0185 |
Excel formula:
=SPIRAL(0.01, 0.1, 0.02, 0.01, 0.0185)
Expected output:
| Result |
|---|
| 7.9509 |
Example 2: Wide radius range spiral
Inputs:
| Di | rmax | rmin | pitch | fd |
|---|---|---|---|---|
| 0.015 | 0.2 | 0.05 | 0.015 | 0.02 |
Excel formula:
=SPIRAL(0.015, 0.2, 0.05, 0.015, 0.02)
Expected output:
| Result |
|---|
| 13.4557 |
Example 3: Tight pitch spiral
Inputs:
| Di | rmax | rmin | pitch | fd |
|---|---|---|---|---|
| 0.01 | 0.1 | 0.02 | 0.005 | 0.0185 |
Excel formula:
=SPIRAL(0.01, 0.1, 0.02, 0.005, 0.0185)
Expected output:
| Result |
|---|
| 15.8408 |
Example 4: Small spiral
Inputs:
| Di | rmax | rmin | pitch | fd |
|---|---|---|---|---|
| 0.008 | 0.08 | 0.02 | 0.01 | 0.022 |
Excel formula:
=SPIRAL(0.008, 0.08, 0.02, 0.01, 0.022)
Expected output:
| Result |
|---|
| 7.0637 |
Python Code
import micropip
await micropip.install(["fluids"])
from fluids.fittings import spiral as fluids_spiral
def spiral(Di, rmax, rmin, pitch, fd):
"""
Calculate the loss coefficient (K) for a spiral coil pipe section.
See: https://fluids.readthedocs.io/fluids.fittings.html#fluids.fittings.spiral
This example function is provided as-is without any representation of accuracy.
Args:
Di (float): Inside diameter of pipe [m]
rmax (float): Radius of spiral at extremity [m]
rmin (float): Radius of spiral at end near center [m]
pitch (float): Distance between two subsequent coil centers [m]
fd (float): Darcy friction factor [-]
Returns:
float: Loss coefficient K for the spiral [-]
"""
try:
Di = float(Di)
rmax = float(rmax)
rmin = float(rmin)
pitch = float(pitch)
fd = float(fd)
except (ValueError, TypeError):
return "Error: All parameters must be numbers."
if Di <= 0:
return "Error: Di must be positive."
if rmax <= 0 or rmin <= 0:
return "Error: Rmax and rmin must be positive."
if rmax <= rmin:
return "Error: Rmax must be greater than rmin."
if pitch <= 0:
return "Error: Pitch must be positive."
if fd <= 0:
return "Error: Fd must be positive."
try:
result = fluids_spiral(Di=Di, rmax=rmax, rmin=rmin, pitch=pitch, fd=fd)
return float(result)
except Exception as e:
return f"Error: {str(e)}"